$(document).ready(function(){

	$("#pageSelection").bind("change",function(){
		$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/fundApprovementList.htm",{pageIndex:$("#pageSelection").val()});
	});
	
	$("#previousButton").bind("click",function(){
		$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/fundApprovementList.htm",{pageIndex:$("#previousPageIndex").val()});
	});
	
	$("#nextButton").bind("click",function(){
		$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/fundApprovementList.htm",{pageIndex:$("#nextPageIndex").val()});
	});

});


function approve(id){
//	$("#row_"+id).remove();
	$("#operate_"+id).text("处理中。。。");
	$.post(getRootPath()+ "/MainMenu/fund/approveFundApplication.htm",{"fundApplicationId":id},function(data){
		if(data.error){
			alert(data.error);
		}else{
			$("#operate_"+id).text("---已批准---");
		}
	});
}

function reject(id){
	$("#rejectReasonDiv").dialog("open");
	$("#applicationId").val(id);
//	$.post(getRootPath()+ "/MainMenu/fund/rejectFundApplication.htm",{"fundApplicationId":id},function(data){
//		if(data.error){
//			alert(data.error);
//		}else{
//			$("#operate_"+id).text("---已拒绝---");
//		}
//	});
}